package com.boarsoft.message.rabbitmq;

import javax.sound.midi.Receiver;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.beans.factory.annotation.Autowired;

import com.boarsoft.message.bean.Message;
import com.boarsoft.message.core.MessageService;

public class RabbitMQClientEx implements MessageService {
	private final Logger log = LoggerFactory.getLogger(Receiver.class);
	
	@Autowired
	private RabbitTemplate template;
	
	@Autowired
	private MessageConverter converter;
	
	public void init(){
	}

	public void put(Message m) {
		template.setMessageConverter(converter);
		template.convertAndSend(m);
	}
}
